package singleton.lazy;

/**
 * 懒汉式
 */
public class Singleton {
    private static Singleton INSTANCE = null;
    private Singleton(){

    }
    public static Singleton getInstance(){
        // 调用时创建实例
        if (INSTANCE == null){
            INSTANCE = new Singleton();
        }
        return INSTANCE;
    }
}
